<?php
/**
 * product_listing_alpha_sorter module
 *
 * @package modules
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: product_listing_alpha_sorter.php 4330 2006-08-31 17:10:26Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
// build alpha sorter dropdown
	$letters_list = '';
	if (isset($_GET['cPath'])&&preg_match('/^[0-9]+[0-9_]*$/', $_GET['cPath'])){
		$cPath_parameter = '&cPath='.$_GET['cPath']; 
	}else{
		$cPath_parameter = '';
	}
    for ($i=65; $i<91; $i++) {
      if ($_GET['alpha_filter_id']==$i)
        $letters_list .= '<a style="color:red">'.chr($i).'</a>';
      else
        $letters_list .= '<a href="'.zen_href_link(FILENAME_DEFAULT,'alpha_filter_id='.$i.$cPath_parameter).'">'.chr($i).'</a>';
    }
    for ($i=48; $i<58; $i++) {
      if ($_GET['alpha_filter_id']==$i)
        $letters_list .= '<a style="color:red">'.chr($i).'</a>';
      else  	
        $letters_list .= '<a href="'.zen_href_link(FILENAME_DEFAULT,'alpha_filter_id='.$i.$cPath_parameter).'">'.chr($i).'</a>';
    }
    echo '<div id="alpha_filter_list">';
    echo '<label style="margin-right:10px">Tag List:</label>' . $letters_list;
    echo '</div>';
?>